package com.cx.common.exception;


import com.cx.common.restful.ResultCode;

/**
 * Author:CHENXIAOYI
 * Since:2020/11/3 11:35
 */
public class BaseException extends RuntimeException {

    private ResultCode resultCode;

    public BaseException() {
    }

    public BaseException(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public BaseException(String msg) {
        super(msg);
    }

    public BaseException(String message, ResultCode resultCode) {
        super(String.valueOf(resultCode.getCode()),new Throwable(resultCode.getMessage()));
        this.resultCode = resultCode;
    }

    public BaseException(int code, String msg){
        super(String.valueOf(code),new Throwable(msg));
    }

    public BaseException(String message, Throwable cause, ResultCode resultCode) {
        super(message, cause);
        this.resultCode = resultCode;
    }

    public BaseException(Throwable cause, ResultCode resultCode) {
        super(cause);
        this.resultCode = resultCode;
    }

}
